package com.ningxia.water.configuration.quartz.job;

import com.ningxia.water.service.ITsWellMeterService;
import com.ningxia.water.utils.LogUtils;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 聚合天表
 *
 * @author huangzhen
 * @create 2021-05-19 10:30
 */
@DisallowConcurrentExecution
@Component
public class DayTableJob implements Job {

    @Autowired
    private ITsWellMeterService wellMeterService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        LogUtils.getLogInstance().info("===============开始执行天表聚合================");

        try {
            wellMeterService.groupDayVolume();
            LogUtils.getLogInstance().info("===============天表聚合任务执行成功================");
        } catch (Exception e) {
            LogUtils.getLogInstance().error("===============天表聚合任务执行失败================");
            e.printStackTrace();
        }

    }
}
